export default class Clone {
  /**
   * 浅克隆
   * @param obj
   * @returns {undefined}
   */
  static clone(obj) {
    if (obj) {
      const newObj = {};
      for (let key in obj) {
        newObj[key] = obj[key];
      }
      return newObj
    }
    return undefined;
  }


  static cloneNot(obj,param) {
    if (obj) {
      const newObj = {};
      for (let key in obj) {
        if(key === param)continue;
        newObj[key] = obj[key];
      }
      return newObj
    }
    return undefined;
  }

  /**
   * 浅拷贝
   * @param obj
   * @returns {undefined}
   */
  static copy(src, dest) {
    for (const key in src) {
      dest[key] = src[key];
    }
    return dest;
  }
  static copyNot(src, dest,param) {
    for (const key in src) {
      if(key === param)continue;
      dest[key] = src[key];
    }
    return dest;
  }
}
